<?php

FLEA::loadClass('Controller_BaseController');

class Controller_Goods extends Controller_BaseController
{
	

    function Controller_Goods() {
        
		$this->table = & FLEA::getSingleton('Table_Goods');
		
		$dispatcher =& $this->_getDispatcher();
        $user = $dispatcher->getUser();
		if(isset($user['terminal_id'])&&null!=$user['terminal_id'])
			$this->conditions='terminal_id='.$user['terminal_id'];

    }
    
	function actionBoList(){
		FLEA::loadClass('FLEA_Ajax');
		
		$arr=$this->table->findAll($this->conditions,null,null,'goods_id , name');

		echo '{Result:'.json_encode($arr).'}';
   }
	
}    
?>